package com.taoyuan.hotel.controller;

import com.taoyuan.hotel.entity.Park;
import com.taoyuan.hotel.service.intf.ParkService;
import com.taoyuan.hotel.vo.PageBean;
import com.taoyuan.hotel.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/park/")
public class ParkController {
    @Autowired
    private ParkService service;

    @PostMapping("save.do")
    public R save(Park park) {return service.save(park);}

    @GetMapping("page.do")
    public PageBean page(int page, int limit) {return service.all(page,limit);}

    @PostMapping("update.do")
    public R update(Park park){return service.update(park);}

    @PostMapping("del.do")
    public R del(int id){return service.del(id);}

    @GetMapping("pagewhere.do")
    public PageBean page(Integer rid,int page,int limit){return service.queryDetail(rid,page,limit);}

    @PostMapping("delbatch.do")
    public R del(@RequestBody int[] ids){return service.delBatch(ids);}
}
